<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8"/>
        <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
        <meta http-equiv="X-UA-Compatible" content="ie=edge"/>
        <title>Document</title>
        <style>
            #div1{width: 600px; height: 100px; text-align: center; line-height: 100px; margin: 100px auto; border: 1px solid black; font-size: 30px}
        </style>
        <script src = 'tool.js'></script>
        <script>
            setInterval(function(){
                
                var oDiv = document.getElementById("div1");
                oDiv.innerHTML = showTime();

            }, 1000);

        </script>
    </head>
    <body>
        <div id = 'div1'>显示当前时间</div>
    </body>
</html>